package com.ruoyi.cms.blog.controller;

import com.ruoyi.cms.blog.domain.CmsCity;
import com.ruoyi.cms.blog.service.ICmsCityService;
import com.ruoyi.common.core.domain.AjaxResult;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * stateAndCityManagement
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/cms/city")
public class CmsCityController {

    private final ICmsCityService iCmsCityService;

    @PostMapping("/select")
    public AjaxResult select(@RequestBody(required = false) CmsCity city) {
        return iCmsCityService.select(city);
    }

    @PostMapping("/select3")
    public AjaxResult select3() {
        return iCmsCityService.select3();
    }

    @PostMapping("/select2")
    public AjaxResult select2(@RequestBody(required = false) CmsCity city) {
        return iCmsCityService.select2(city);
    }

    @PostMapping
    public AjaxResult insert(@RequestBody CmsCity city) {
        return iCmsCityService.insert(city);
    }

    @PutMapping
    public AjaxResult update(@RequestBody CmsCity city) {
        return iCmsCityService.update(city);
    }

    @DeleteMapping("/{id}")
    public AjaxResult delete(@PathVariable Long id) {
        return iCmsCityService.delete(id);
    }
}
